package com.jy.framework.constant;

/**
 * @author JuiceYan
 * @date 2018/12/27/027
 */
public enum  UserStatusEnum {

    ENABLED(1,"正常"),
    DISABLED(0,"停用");

    private int code;
    private String value;
    UserStatusEnum(int code,String value) {
        this.code = code;
        this.value = value;
    }

    public int getCode() {
        return  code;
    }

    public  String getValue() {
        return value;
    }

    public static  UserStatusEnum codeOf(int index) {
        for (UserStatusEnum userStatus :values()) {
            if (userStatus.code == index) {
                return userStatus;
            }
        }
        return null;
    }
}
